package cn.codeforfun.controller;

import cn.codeforfun.entity.User;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

/**
 * Package cn.codeforfun.controller
 * Project framework-demo
 * Author WangBin
 * Email bin.wang12@pactera.com
 * Created on 2017/5/3 16:41
 * version 1.0.0
 */
@RestController
@RequestMapping("/test2")
public class TestController2 {
  @RequestMapping(value = "/post", method = RequestMethod.POST)
  public String post(@RequestBody User user) {
    System.out.println(user.toString());
    return "test2/post";
  }

  @RequestMapping(value = "/get", method = RequestMethod.GET)
  public String get(@PathParam("aaa") String aaa, @PathParam("bbb") String bbb) {
    return aaa + "--------" + bbb;
  }
}
